/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.asseco.mio.codex;



import java.util.Date;
import javax.persistence.*;
import org.appfuse.model.BaseObject;
import org.hibernate.annotations.GenericGenerator;
import org.springmodules.validation.bean.conf.loader.annotation.handler.NotEmpty;

/**
 *
 * @author gjoko.mitrovski
 */
@Entity @Table(name="INDUSTRY")
public class Industry extends BaseObject {

    
    private String id;
    private String name;
    private String code;
    private String descr;
    private Boolean status = true;
    private Date activeDate;
    private Date passiveDate;

    @Column(name = "ACTIVE_DATE")
    @Temporal(value = javax.persistence.TemporalType.TIMESTAMP)
    public Date getActiveDate() {
        return activeDate;
    }

    public void setActiveDate(Date activeDate) {
        this.activeDate = activeDate;
    }
    @NotEmpty
    @Column(name = "INDUSTRY_CODE", length = 50)
    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }
    @Column(name = "INDUSTRY_DESC", length = 4096)
    public String getDescr() {
        return descr;
    }

    public void setDescr(String descr) {
        this.descr = descr;
    }
@Id
    @GeneratedValue(generator = "system-uuid")
    @Column(length = 40)
 @GenericGenerator(name="system-uuid", strategy = "uuid")
    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }
    @NotEmpty
    @Column(name = "INDUSTRY_NAME", length = 1000)
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
    @Column(name = "PASSIVE_DATE")
    @Temporal(value = javax.persistence.TemporalType.TIMESTAMP)
    public Date getPassiveDate() {
        return passiveDate;
    }

    public void setPassiveDate(Date passiveDate) {
        this.passiveDate = passiveDate;
    }
    @Column(name = "STATUS")
    public Boolean getStatus() {
        return status;
    }

    public void setStatus(Boolean status) {
        this.status = status;
    }

    @Override
    public String toString() {
        return "Industry{" + "id=" + id + "name=" + name + "code=" + code + "descr=" + descr + "status=" + status + "activeDate=" + activeDate + "passiveDate=" + passiveDate + '}';
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final Industry other = (Industry) obj;
        if ((this.id == null) ? (other.id != null) : !this.id.equals(other.id)) {
            return false;
        }
        return true;
    }

    @Override
    public int hashCode() {
        int hash = 5;
        hash = 67 * hash + (this.id != null ? this.id.hashCode() : 0);
        hash = 67 * hash + (this.name != null ? this.name.hashCode() : 0);
        hash = 67 * hash + (this.code != null ? this.code.hashCode() : 0);
        hash = 67 * hash + (this.descr != null ? this.descr.hashCode() : 0);
        hash = 67 * hash + (this.status != null ? this.status.hashCode() : 0);
        hash = 67 * hash + (this.activeDate != null ? this.activeDate.hashCode() : 0);
        hash = 67 * hash + (this.passiveDate != null ? this.passiveDate.hashCode() : 0);
        return hash;
    }

    


}
